User tools send evtchn notifications via /dev/xen/evtchn
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 6 Oct 2005 16:02:38 +0000 (17:02 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Thu, 6 Oct 2005 16:02:38 +0000 (17:02 +0100)
rather than using hypercall directly.

Signed-off-by: Keir Fraser <keir@xensource.com>
14 files changed:
linux-2.6-xen-sparse/drivers/xen/evtchn/evtchn.c
linux-2.6-xen-sparse/include/asm-xen/linux-public/evtchn.h
tools/console/daemon/io.c
tools/ioemu/target-i386-dm/helper2.c
tools/libxc/xc_evtchn.c
tools/libxc/xenctrl.h
tools/python/xen/lowlevel/xc/xc.c
tools/xenstore/Makefile
tools/xenstore/fake_libxc.c
tools/xenstore/xenstored_core.c
tools/xenstore/xenstored_core.h
tools/xenstore/xenstored_domain.c
tools/xenstore/xenstored_domain.h
tools/xenstore/xs_dom0_test.c [deleted file]

index 658157c4c36dbbbd5c0788aa7b13d6418f42b6ae..b273e65fbd4b89ea178aea5f145c763c1eb5b27f 100644 (file)
@@ -297,6 +297,24 @@ static int evtchn_ioctl(struct inode *inode, struct file *file,
                break;
        }
 
+       case IOCTL_EVTCHN_NOTIFY: {
+               struct ioctl_evtchn_notify notify;
+
+               rc = -EFAULT;
+               if (copy_from_user(&notify, (void *)arg, sizeof(notify)))
+                       break;
+
+               if (notify.port >= NR_EVENT_CHANNELS) {
+                       rc = -EINVAL;
+               } else if (port_user[notify.port] != u) {
+                       rc = -ENOTCONN;
+               } else {
+                       notify_remote_via_evtchn(notify.port);
+                       rc = 0;
+               }
+               break;
+       }
+
        case IOCTL_EVTCHN_RESET: {
                /* Initialise the ring to empty. Clear errors. */
                u->ring_cons = u->ring_prod = u->ring_overflow = 0;
index 9f47eaf44c8afe60b684f8c5945e4d20ec6b851a..456f246530857b965fde7b5b346a3f084e475514 100644 (file)
@@ -72,9 +72,18 @@ struct ioctl_evtchn_unbind {
        unsigned int port;
 };
 
+/*
+ * Unbind previously allocated @port.
+ */
+#define IOCTL_EVTCHN_NOTIFY                            \
+       _IOC(_IOC_NONE, 'E', 4, sizeof(struct ioctl_evtchn_notify))
+struct ioctl_evtchn_notify {
+       unsigned int port;
+};
+
 /* Clear and reinitialise the event buffer. Clear error condition. */
 #define IOCTL_EVTCHN_RESET                             \
-       _IOC(_IOC_NONE, 'E', 4, 0)
+       _IOC(_IOC_NONE, 'E', 5, 0)
 
 #endif /* __LINUX_PUBLIC_EVTCHN_H__ */
 
index dab3177d143bd2385b4ef29cd616540bbdcc4da2..cde27b2dc78545f6a48654572e1c58697fed57a7 100644 (file)
@@ -81,6 +81,13 @@ struct ring_head
 #define XENCONS_FULL(ring) (((ring)->prod - (ring)->cons) == XENCONS_RING_SIZE)
 #define XENCONS_SPACE(ring) (XENCONS_RING_SIZE - ((ring)->prod - (ring)->cons))
 
+static void evtchn_notify(struct domain *dom)
+{
+       struct ioctl_evtchn_notify notify;
+       notify.port = dom->local_port;
+       (void)ioctl(dom->evtchn_fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+
 static void buffer_append(struct domain *dom)
 {
        struct buffer *buffer = &dom->buffer;
@@ -121,7 +128,7 @@ static void buffer_append(struct domain *dom)
        }
 
        if (notify)
-               xc_evtchn_send(xc, dom->local_port);
+               evtchn_notify(dom);
 }
 
 static bool buffer_empty(struct buffer *buffer)
@@ -440,7 +447,7 @@ static void handle_tty_read(struct domain *dom)
                        inring->buf[XENCONS_IDX(inring->prod)] = msg[i];
                        inring->prod++;
                }
-               xc_evtchn_send(xc, dom->local_port);
+               evtchn_notify(dom);
        } else {
                close(dom->tty_fd);
                dom->tty_fd = -1;
index d32ef006ba76c1220a1fff09b6476c6d9ab1c422..5f0c3712cce193990dc323040824c932a09c3bcf 100644 (file)
@@ -486,11 +486,9 @@ int main_loop(void)
                     do_ioapic();
 #endif
                if (env->send_event) {
-                       int ret;
-                       ret = xc_evtchn_send(xc_handle, ioreq_local_port);
-                       if (ret == -1) {
-                               fprintf(logfile, "evtchn_send failed on port: %d\n", ioreq_local_port);
-                       }
+                       struct ioctl_evtchn_notify notify;
+                       notify.port = ioreq_local_port;
+                       (void)ioctl(evtchn_fd, IOCTL_EVTCHN_NOTIFY, &notify);
                }
        }
         destroy_vmx_domain();
index ed6256654b56ec83fc145e21bf81c052484ff69e..a318889b8589b4efda9022e07f6ae88ea6eca997 100644 (file)
@@ -33,95 +33,22 @@ static int do_evtchn_op(int xc_handle, evtchn_op_t *op)
 
 
 int xc_evtchn_alloc_unbound(int xc_handle,
-                            u32 remote_dom,
                             u32 dom,
-                            int *port)
+                            u32 remote_dom)
 {
     int         rc;
     evtchn_op_t op = {
         .cmd = EVTCHNOP_alloc_unbound,
-        .u.alloc_unbound.remote_dom = (domid_t)remote_dom,
-        .u.alloc_unbound.dom  = (domid_t)dom,
-        .u.alloc_unbound.port = (port != NULL) ? *port : 0 };
+        .u.alloc_unbound.dom = (domid_t)dom,
+        .u.alloc_unbound.remote_dom = (domid_t)remote_dom };
 
     if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
-    {
-        if ( port != NULL )
-            *port = op.u.alloc_unbound.port;
-    }
-    
-    return rc;
-}
-
-
-int xc_evtchn_bind_interdomain(int xc_handle,
-                               u32 dom1,
-                               u32 dom2,
-                               int *port1,
-                               int *port2)
-{
-    int         rc;
-    evtchn_op_t op = {
-        .cmd = EVTCHNOP_bind_interdomain,
-        .u.bind_interdomain.dom1  = (domid_t)dom1,
-        .u.bind_interdomain.dom2  = (domid_t)dom2,
-        .u.bind_interdomain.port1 = (port1 != NULL) ? *port1 : 0,
-        .u.bind_interdomain.port2 = (port2 != NULL) ? *port2 : 0 };
-
-    if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
-    {
-        if ( port1 != NULL )
-            *port1 = op.u.bind_interdomain.port1;
-        if ( port2 != NULL )
-            *port2 = op.u.bind_interdomain.port2;
-    }
-    
-    return rc;
-}
-
-
-int xc_evtchn_bind_virq(int xc_handle,
-                        int virq,
-                        int *port)
-{
-    int         rc;
-    evtchn_op_t op = {
-        .cmd = EVTCHNOP_bind_virq,
-        .u.bind_virq.virq = (u32)virq,
-        .u.bind_virq.vcpu = 0 };
-
-    if ( (rc = do_evtchn_op(xc_handle, &op)) == 0 )
-    {
-        if ( port != NULL )
-            *port = op.u.bind_virq.port;
-    }
+        rc = op.u.alloc_unbound.port;
     
     return rc;
 }
 
 
-int xc_evtchn_close(int xc_handle,
-                    u32 dom,
-                    int port)
-{
-    evtchn_op_t op = {
-        .cmd          = EVTCHNOP_close,
-        .u.close.dom  = (domid_t)dom,
-        .u.close.port = port };
-    return do_evtchn_op(xc_handle, &op);
-}
-
-
-int xc_evtchn_send(int xc_handle,
-                   int local_port)
-{
-    evtchn_op_t op = {
-        .cmd = EVTCHNOP_send,
-        .u.send.local_port = local_port };
-    return do_evtchn_op(xc_handle, &op);
-}
-
-
 int xc_evtchn_status(int xc_handle,
                      u32 dom,
                      int port,
index 3e74c62fa0c5ab65c6246e5d1d49f0b6dede1505..5ba19a891b03a89729bee97f9849e092e1107660 100644 (file)
@@ -306,68 +306,14 @@ typedef evtchn_status_t xc_evtchn_status_t;
  * well-known port within a domain to receive events on.
  *
  * @parm xc_handle a handle to an open hypervisor interface
- * @parm remote_dom the ID of the domain who will later bind
  * @parm dom the ID of the local domain (the 'allocatee')
- * @parm port a pointer to a port.  This is an in/out parameter.  If *port is
- *            0, then a new port will be assigned, if port is > 0 then that
- *            port is allocated if the port is unallocated.
- * @return 0 on success, -1 on failure
+ * @parm remote_dom the ID of the domain who will later bind
+ * @return allocated port (in @dom) on success, -1 on failure
  */
 int xc_evtchn_alloc_unbound(int xc_handle,
-                            u32 remote_dom,
                             u32 dom,
-                            int *port);
-
-/**
- * This function creates a pair of ports between two domains.  A port can only
- * be bound once within a domain.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm dom1 one of the two domains to connect.  Can be DOMID_SELF.
- * @parm dom2 the other domain to connect.  Can be DOMID_SELF.
- * @parm port1 an in/out parameter.  If > 0, then try to connect *port.  If
- *             0, then allocate a new port and store the port in *port.
- * @parm port2 the port connected on port2.  This parameter behaves the same
- *             way as port1.
- * @return 0 on success, -1 on error.
- */
-int xc_evtchn_bind_interdomain(int xc_handle,
-                               u32 dom1,
-                               u32 dom2,
-                               int *port1,
-                               int *port2);
-int xc_evtchn_bind_virq(int xc_handle,
-                        int virq,
-                        int *port);
-
-/**
- * This function will close a single port on an event channel.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm dom the domain that the port exists on.  May be DOMID_SELF.
- * @parm port the port to close
- * @return 0 on success, -1 on error
- */
-int xc_evtchn_close(int xc_handle,
-                    u32 dom,   /* may be DOMID_SELF */
-                    int port);
+                            u32 remote_dom);
 
-/**
- * This function generates a notify event on a bound port.
- *
- * Notifies can be read within Linux by opening /dev/xen/evtchn and reading
- * a 16 bit value.  The result will be the port the event occurred on.  When
- * events occur, the port is masked until the 16 bit port value is written back
- * to the file.  When /dev/xen/evtchn is opened, it has to be bound via an
- * ioctl to each port to listen on.  The ioctl for binding is _IO('E', 2).  The
- * parameter is the port to listen on.
- *
- * @parm xc_handle a handle to an open hypervisor interface
- * @parm local_port the port to generate the notify on
- * @return 0 on success, -1 on error
- */
-int xc_evtchn_send(int xc_handle,
-                   int local_port);
 int xc_evtchn_status(int xc_handle,
                      u32 dom, /* may be DOMID_SELF */
                      int port,
index 5074b4b3c6225f41dc600946ad65703d5ea5a62f..f42dce8d4c79ed35a9164eec08736ece8041f224 100644 (file)
@@ -433,7 +433,7 @@ static PyObject *pyxc_evtchn_alloc_unbound(PyObject *self,
     XcObject *xc = (XcObject *)self;
 
     u32 dom = DOMID_SELF, remote_dom;
-    int port = 0;
+    int port;
 
     static char *kwd_list[] = { "remote_dom", "dom", NULL };
 
@@ -441,97 +441,12 @@ static PyObject *pyxc_evtchn_alloc_unbound(PyObject *self,
                                       &remote_dom, &dom) )
         return NULL;
 
-    if ( xc_evtchn_alloc_unbound(xc->xc_handle, remote_dom, dom, &port) != 0 )
-        return PyErr_SetFromErrno(xc_error);
-
-    return PyInt_FromLong(port);
-}
-
-static PyObject *pyxc_evtchn_bind_interdomain(PyObject *self,
-                                              PyObject *args,
-                                              PyObject *kwds)
-{
-    XcObject *xc = (XcObject *)self;
-
-    u32 dom1 = DOMID_SELF, dom2 = DOMID_SELF;
-    int port1 = 0, port2 = 0;
-
-    static char *kwd_list[] = { "dom1", "dom2", "port1", "port2", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "|iiii", kwd_list, 
-                                      &dom1, &dom2, &port1, &port2) )
-        return NULL;
-
-    if ( xc_evtchn_bind_interdomain(xc->xc_handle, dom1, 
-                                    dom2, &port1, &port2) != 0 )
-        return PyErr_SetFromErrno(xc_error);
-
-    return Py_BuildValue("{s:i,s:i}", 
-                         "port1", port1,
-                         "port2", port2);
-}
-
-static PyObject *pyxc_evtchn_bind_virq(PyObject *self,
-                                       PyObject *args,
-                                       PyObject *kwds)
-{
-    XcObject *xc = (XcObject *)self;
-
-    int virq, port;
-
-    static char *kwd_list[] = { "virq", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &virq) )
-        return NULL;
-
-    if ( xc_evtchn_bind_virq(xc->xc_handle, virq, &port) != 0 )
+    if ( (port = xc_evtchn_alloc_unbound(xc->xc_handle, dom, remote_dom)) < 0 )
         return PyErr_SetFromErrno(xc_error);
 
     return PyInt_FromLong(port);
 }
 
-static PyObject *pyxc_evtchn_close(PyObject *self,
-                                   PyObject *args,
-                                   PyObject *kwds)
-{
-    XcObject *xc = (XcObject *)self;
-
-    u32 dom = DOMID_SELF;
-    int port;
-
-    static char *kwd_list[] = { "port", "dom", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i|i", kwd_list, 
-                                      &port, &dom) )
-        return NULL;
-
-    if ( xc_evtchn_close(xc->xc_handle, dom, port) != 0 )
-        return PyErr_SetFromErrno(xc_error);
-
-    Py_INCREF(zero);
-    return zero;
-}
-
-static PyObject *pyxc_evtchn_send(PyObject *self,
-                                  PyObject *args,
-                                  PyObject *kwds)
-{
-    XcObject *xc = (XcObject *)self;
-
-    int port;
-
-    static char *kwd_list[] = { "port", NULL };
-
-    if ( !PyArg_ParseTupleAndKeywords(args, kwds, "i", kwd_list, &port) )
-        return NULL;
-
-    if ( xc_evtchn_send(xc->xc_handle, port) != 0 )
-        return PyErr_SetFromErrno(xc_error);
-
-    Py_INCREF(zero);
-    return zero;
-}
-
 static PyObject *pyxc_evtchn_status(PyObject *self,
                                     PyObject *args,
                                     PyObject *kwds)
@@ -1032,38 +947,6 @@ static PyMethodDef pyxc_methods[] = {
       " dom [int]: Remote domain to accept connections from.\n\n"
       "Returns: [int] Unbound event-channel port.\n" },
 
-    { "evtchn_bind_interdomain", 
-      (PyCFunction)pyxc_evtchn_bind_interdomain, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Open an event channel between two domains.\n"
-      " dom1 [int, SELF]: First domain to be connected.\n"
-      " dom2 [int, SELF]: Second domain to be connected.\n\n"
-      "Returns: [dict] dictionary is empty on failure.\n"
-      " port1 [int]: Port-id for endpoint at dom1.\n"
-      " port2 [int]: Port-id for endpoint at dom2.\n" },
-
-    { "evtchn_bind_virq", 
-      (PyCFunction)pyxc_evtchn_bind_virq, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Bind an event channel to the specified VIRQ.\n"
-      " virq [int]: VIRQ to bind.\n\n"
-      "Returns: [int] Bound event-channel port.\n" },
-
-    { "evtchn_close", 
-      (PyCFunction)pyxc_evtchn_close, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Close an event channel. If interdomain, sets remote end to 'unbound'.\n"
-      " dom  [int, SELF]: Dom-id of one endpoint of the channel.\n"
-      " port [int]:       Port-id of one endpoint of the channel.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
-    { "evtchn_send", 
-      (PyCFunction)pyxc_evtchn_send, 
-      METH_VARARGS | METH_KEYWORDS, "\n"
-      "Send an event along a locally-connected event channel.\n"
-      " port [int]: Port-id of a local channel endpoint.\n\n"
-      "Returns: [int] 0 on success; -1 on error.\n" },
-
     { "evtchn_status", 
       (PyCFunction)pyxc_evtchn_status, 
       METH_VARARGS | METH_KEYWORDS, "\n"
index 7930789c8ceb7e4ea89846a9d759495ed66c5bcc..3b82bf2887488d68edb7272f750f7a65b2b97046 100644 (file)
@@ -29,7 +29,7 @@ CLIENTS_OBJS := $(patsubst xenstore-%,xenstore_%.o,$(CLIENTS))
 
 all: libxenstore.so xenstored $(CLIENTS) xs_tdb_dump
 
-testcode: xs_test xenstored_test xs_random xs_dom0_test
+testcode: xs_test xenstored_test xs_random
 
 xenstored: xenstored_core.o xenstored_watch.o xenstored_domain.o xenstored_transaction.o xs_lib.o talloc.o utils.o tdb.o
        $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
@@ -74,7 +74,7 @@ libxenstore.so: xs.opic xs_lib.opic
 clean: testsuite-clean
        rm -f *.o *.opic *.so
        rm -f xenstored xs_random xs_stress xs_crashme
-       rm -f xs_test xenstored_test xs_dom0_test
+       rm -f xs_test xenstored_test
        $(RM) $(PROG_DEP)
 
 print-dir:
@@ -120,9 +120,6 @@ stresstest: xs_stress xenstored_test $(TESTDIR)
        rm -rf $(TESTDIR)/store $(TESTDIR)/transactions
        export $(TESTENV); PID=`./xenstored_test --output-pid --trace-file=/tmp/trace`; ./xs_stress 5000; ret=$$?; kill $$PID; exit $$ret
 
-xs_dom0_test: xs_dom0_test.o utils.o
-       $(LINK.o) $^ $(LOADLIBES) $(LDLIBS) -lxenctrl -o $@
-
 TAGS:
        etags `find . -name '*.[ch]'`
 
index a435d65bd0d06cc25c79e9adc87f5145b3fc023e..5a02b2e597fdf1d14035c313bd209b5bb7771121 100644 (file)
@@ -36,12 +36,11 @@ static int xs_test_pid;
 static u16 port;
 
 /* The event channel maps to a signal, shared page to an mmapped file. */
-int xc_evtchn_send(int xc_handle __attribute__((unused)), int local_port)
+void evtchn_notify(int local_port)
 {
        assert(local_port == port);
        if (kill(xs_test_pid, SIGUSR2) != 0)
                barf_perror("fake event channel failed");
-       return 0;
 }
 
 void *xc_map_foreign_range(int xc_handle, u32 dom __attribute__((unused)),
@@ -107,15 +106,6 @@ int xc_domain_getinfo(int xc_handle __attribute__((unused)),
        return 1;
 }
 
-int xc_evtchn_bind_virq(int xc_handle __attribute__((unused)),
-                       int virq __attribute__((unused)),
-                       int *port)
-{
-       if (port)
-               *port = 0;
-       return 0;
-}
-
 static void send_to_fd(int signo __attribute__((unused)))
 {
        int saved_errno = errno;
index b892b8517e9bad62d00a70cb56b22708edf0288b..da305ad7ce9a42b0603c6641d2738f4eee5ee193 100644 (file)
@@ -52,6 +52,8 @@
 #include "xenctrl.h"
 #include "tdb.h"
 
+int event_fd;
+
 static bool verbose;
 LIST_HEAD(connections);
 static int tracefd = -1;
@@ -309,8 +311,7 @@ static int destroy_conn(void *_conn)
        return 0;
 }
 
-static int initialize_set(fd_set *inset, fd_set *outset, int sock, int ro_sock,
-                         int event_fd)
+static int initialize_set(fd_set *inset, fd_set *outset, int sock, int ro_sock)
 {
        struct connection *i;
        int max;
@@ -1464,7 +1465,7 @@ static struct option options[] = {
 
 int main(int argc, char *argv[])
 {
-       int opt, *sock, *ro_sock, event_fd, max;
+       int opt, *sock, *ro_sock, max;
        struct sockaddr_un addr;
        fd_set inset, outset;
        bool dofork = true;
@@ -1568,7 +1569,7 @@ int main(int argc, char *argv[])
 #endif
 
        /* Get ready to listen to the tools. */
-       max = initialize_set(&inset, &outset, *sock, *ro_sock, event_fd);
+       max = initialize_set(&inset, &outset, *sock, *ro_sock);
 
        /* Main loop. */
        /* FIXME: Rewrite so noone can starve. */
@@ -1588,7 +1589,7 @@ int main(int argc, char *argv[])
                        accept_connection(*ro_sock, false);
 
                if (FD_ISSET(event_fd, &inset))
-                       handle_event(event_fd);
+                       handle_event();
 
                list_for_each_entry(i, &connections, list) {
                        if (i->domain)
@@ -1624,7 +1625,6 @@ int main(int argc, char *argv[])
                        }
                }
 
-               max = initialize_set(&inset, &outset, *sock, *ro_sock,
-                                    event_fd);
+               max = initialize_set(&inset, &outset, *sock, *ro_sock);
        }
 }
index 404343b734583b645017dee4a7bd2e2e23cedc23..1967d8425caa4db3d04f2b4a342aac25d6e3a09d 100644 (file)
@@ -173,4 +173,6 @@ void trace_destroy(const void *data, const char *type);
 void trace_watch_timeout(const struct connection *conn, const char *node, const char *token);
 void trace(const char *fmt, ...);
 
+extern int event_fd;
+
 #endif /* _XENSTORED_CORE_H */
index 69ace083d9559a2d603db686301658f8df4d8a33..a7cd4493ad73d6e2d6420e02beb34c607f3bf9a1 100644 (file)
@@ -79,6 +79,17 @@ struct ringbuf_head
        char buf[0];
 } __attribute__((packed));
 
+#ifndef TESTING
+static void evtchn_notify(int port)
+{
+       struct ioctl_evtchn_notify notify;
+       notify.port = port;
+       (void)ioctl(event_fd, IOCTL_EVTCHN_NOTIFY, &notify);
+}
+#else
+extern void evtchn_notify(int port);
+#endif
+
 /* FIXME: Mark connection as broken (close it?) when this happens. */
 static bool check_buffer(const struct ringbuf_head *h)
 {
@@ -164,9 +175,7 @@ static int writechn(struct connection *conn, const void *data, unsigned int len)
        memcpy(dest, data, len);
        mb();
        update_output_chunk(conn->domain->output, len);
-       /* FIXME: Probably not neccessary. */
-       mb();
-       xc_evtchn_send(*xc_handle, conn->domain->port);
+       evtchn_notify(conn->domain->port);
        return len;
 }
 
@@ -199,7 +208,7 @@ static int readchn(struct connection *conn, void *data, unsigned int len)
 
        /* If it was full, tell them we've taken some. */
        if (was_full)
-               xc_evtchn_send(*xc_handle, conn->domain->port);
+               evtchn_notify(conn->domain->port);
        return len;
 }
 
@@ -249,7 +258,7 @@ static void domain_cleanup(void)
 }
 
 /* We scan all domains rather than use the information given here. */
-void handle_event(int event_fd)
+void handle_event(void)
 {
        u16 port;
 
index a896e1a3af3c7ea4a26d9b13f47def4456c8b15f..e8d5ec8c880f18d15317a0ae1028760159f84dc6 100644 (file)
@@ -20,7 +20,7 @@
 #ifndef _XENSTORED_DOMAIN_H
 #define _XENSTORED_DOMAIN_H
 
-void handle_event(int event_fd);
+void handle_event(void);
 
 /* domid, mfn, eventchn, path */
 void do_introduce(struct connection *conn, struct buffered_data *in);
diff --git a/tools/xenstore/xs_dom0_test.c b/tools/xenstore/xs_dom0_test.c
deleted file mode 100644 (file)
index e92c347..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-/* Test introduction of domain 0 */
-#include <linux/ioctl.h>
-#include <sys/ioctl.h>
-#include "xs.h"
-#include "utils.h"
-#include <xenctrl.h>
-#include <xen/linux/privcmd.h>
-#include <stdio.h>
-#include <unistd.h>
-#include <sys/mman.h>
-
-int main()
-{
-       int h, local = 0, kernel = 0;
-       long err;
-       void *page;
-
-       h = xc_interface_open();
-       if (h < 0)
-               barf_perror("Failed to open xc");
-
-       if (xc_evtchn_bind_interdomain(h, DOMID_SELF, 0, &local, &kernel) != 0)
-               barf_perror("Failed to bind interdomain");
-
-       printf("Got ports %i & %i\n", local, kernel);
-
-       err = ioctl(h, IOCTL_PRIVCMD_INITDOMAIN_STORE, kernel);
-       if (err < 0)
-               barf_perror("Failed to initialize store");
-       printf("Got mfn %li\n", err);
-
-       page = xc_map_foreign_range(h, 0, getpagesize(), PROT_READ|PROT_WRITE,
-                                   err);
-       if (!page)
-               barf_perror("Failed to map page %li", err);
-       printf("Mapped page at %p\n", page);
-       printf("Page says %s\n", (char *)page);
-       munmap(page, getpagesize());
-       printf("unmapped\n");
-       
-       return 0;
-}
-